]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gtk-embed: Handle unmap/map of the embedded window
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 19 Mar 2015 23:06:34 +0000 (00:06 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 22 Mar 2015 08:33:33 +0000 (09:33 +0100)
The current code assumes that an embedded window will correspond to
a single MetaWindow over the entire lifetime of the icon, which is
incorrect - the embedded window is unmanaged on Unmap and a new
MetaWindow will be created the next time the embedded window is
mapped. As we currently ignore the new MetaWindow completely, it
will be shown normally in the scene instead of the embedded clone
as intended.
Fix this by setting up clone and window actor each time the embedded
window is mapped rather than once in shell_gtk_embed_set_window().

https://bugzilla.gnome.org/show_bug.cgi?id=745824

src/shell-gtk-embed.c

index a1e552def8ca7de08052da44c35042b7009b13cd..f18097c1846c3f9fafe425b4b7841f4c276ba24a 100644 (file)
@@ -116,6 +116,21 @@ shell_gtk_embed_window_created_cb (MetaDisplay   *display,
     }
 }
 
+static void
+shell_gtk_embed_on_window_mapped (GtkWidget     *object,
+                                  ShellGtkEmbed *embed)
+{
+  MetaDisplay *display = shell_global_get_display (shell_global_get ());
+
+  /* Listen for new windows so we can detect when Mutter has
+     created a MutterWindow for this window */
+  embed->priv->window_created_handler =
+    g_signal_connect (display,
+                      "window-created",
+                      G_CALLBACK (shell_gtk_embed_window_created_cb),
+                      embed);
+}
+
 static void
 shell_gtk_embed_set_window (ShellGtkEmbed       *embed,
                             ShellEmbeddedWindow *window)
@@ -140,6 +155,10 @@ shell_gtk_embed_set_window (ShellGtkEmbed       *embed,
       g_signal_handlers_disconnect_by_func (embed->priv->window,
                                             (gpointer)shell_gtk_embed_on_window_destroy,
                                             embed);
+
+      g_signal_handlers_disconnect_by_func (embed->priv->window,
+                                            (gpointer)shell_gtk_embed_on_window_mapped,
+                                            embed);
     }
 
   embed->priv->window = window;
@@ -153,13 +172,8 @@ shell_gtk_embed_set_window (ShellGtkEmbed       *embed,
       g_signal_connect (embed->priv->window, "destroy",
                         G_CALLBACK (shell_gtk_embed_on_window_destroy), embed);
 
-      /* Listen for new windows so we can detect when Mutter has
-         created a MutterWindow for this window */
-      embed->priv->window_created_handler =
-        g_signal_connect (display,
-                          "window-created",
-                          G_CALLBACK (shell_gtk_embed_window_created_cb),
-                          embed);
+      g_signal_connect (embed->priv->window, "map",
+                        G_CALLBACK (shell_gtk_embed_on_window_mapped), embed);
     }
 
   clutter_actor_queue_relayout (CLUTTER_ACTOR (embed));